﻿<%@ Page Language="C#" MasterPageFile="~/admin.master" AutoEventWireup="true" Inherits="MediaMonitor.Admin.User_Mgmt_List"
    Theme="default" Title="User Management - List" CodeBehind="user-mgmt-list.aspx.cs" %>


<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src="../rad-scripts/rad.js" type="text/javascript"></script>
    </telerik:RadCodeBlock>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <div style="padding: 5px; width: 90%; position: relative;">
        <div style="text-align: right; padding-bottom: 3px;">
            <a href="user-mgmt-addedit.aspx"><b>Add new User</b></a>
        </div>
        <telerik:RadAjaxPanel ID="pnlUpdate" runat="server" RestoreOriginalRenderDelegate="false">

            <asp:HiddenField ID="hdnCompanyID" runat="server" Value="0" />

            <telerik:RadGrid ID="radGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" GridLines="None" Skin="Hay" OnNeedDataSource="radGrid_NeedDataSource"
                Width="100%" AutoGenerateColumns="false" GroupingSettings-CaseSensitive="false"
                PageSize="15" OnDeleteCommand="radGrid_DeleteCommand">
                <MasterTableView DataKeyNames="SiteUserID" ExpandCollapseColumn-Display="true" GroupLoadMode="Client">
                    <Columns>
                        <telerik:GridButtonColumn Text="Delete" ButtonType="LinkButton" ConfirmText="All related data of this user may also also be deleted. Are you sure to delete this record?"
                            ConfirmTitle="Delete Confirmation" CommandName="Delete" />
                        <telerik:GridTemplateColumn AllowFiltering="false">
                            <ItemTemplate>
                                <a href='user-mgmt-addedit.aspx?uid=<%#Eval("SiteUserID")%>'>Edit</a> 
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                         
                          <telerik:GridTemplateColumn AllowFiltering="false">
                            <ItemTemplate>
                                <a href='user-mgmt-log.aspx?uid=<%#Eval("SiteUserID")%>'>Log</a> 
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>


                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="CompanyName" HeaderText="Company Name" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="UserName" HeaderText="Login Name" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Password" HeaderText="Password" Display="false" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Email" HeaderText="Email" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Cell" HeaderText="Cell#"
                            FilterControlWidth="35" />

                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="ValidFromDate" HeaderText="Valid From" FilterControlWidth="50" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="ValidToDate" HeaderText="Valid To"  FilterControlWidth="50" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="Active" HeaderText="Active" />
                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" DataField="LastModifiedDate" HeaderText="Last Modified"
                            HtmlEncode="false" DataFormatString="{0:d}" FilterControlWidth="50" />
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="false" />
                    <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
                </ClientSettings>
                <FilterMenu OnClientShowing="MenuShowing" />
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </div>
</asp:Content>
